{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f5\fnil\fprq2\fcharset0 MS Mincho;}{\f6\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af5\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af6\afs24\lang255\ai\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
}
{\info{\creatim\yr2011\mo7\dy28\hr6\min52}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using System;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Scene;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Scene.Shape;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Graphics;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Math;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Input;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Core;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 using Tesla.Bounding;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 namespace TeslaSamples.Renderer \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 [AppDescription("Render Queue Sample", PlatformCapabilities.Direct3D10 | PlatformCapabilities.XNA4, "RenderQueueImage", "RenderQueueDesc", "RenderQueueSource")]}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 public class RenderQueueSample : BasicApp \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Node transpNode;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Node orthos;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private ICamera orthoCam;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Box opaqueBox1;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Box opaqueBox2;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Box opaqueBox3;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Box transparentBox;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Teapot transparentTeapot;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Torus transparentTorus;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Quad quad1;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private Quad quad2;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private bool toggleRenderQueue;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private bool toggleTwoPass;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private SpriteBatch batch;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private SpriteFont font;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private String text = "Renderqueue: false (R)\\nTwo Pass Transparency: false (T)";}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 protected override void LoadContent() \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 Window.Title = "Render Queue Sample";}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 toggleRenderQueue = false;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 toggleTwoPass = false;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode = new Node("TransparentNode");}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode.SceneHints.TransparencyType = TransparencyType.OneSided;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 RootNode.AddChild(transpNode);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthos = new Node("OrthoNode");}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthoCam = new Camera(new Viewport());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthoCam.SetFrame(new Vector3(-.5f, -.5f, 0), Matrix.Identity);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1 = new Quad("Quad1", 100, 70);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.Material = ContentManager.Load<Material>("BasicColor.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.Material.SetParameter("DiffuseColor", Color.Blue);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.Translation = new Vector3(Window.ClientBounds.Width / 2, Window.ClientBounds.Height / 2, 0);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.SceneHints.CullHint = CullHint.Never;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.OrthoOrder = 5;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.SetRenderState(DepthStencilState.None);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.SetRenderState(RasterizerState.CullNone);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthos.AddChild(quad1);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2 = new Quad("Quad2", 50, 70);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.Material = ContentManager.Load<Material>("BasicColor.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.Material.SetParameter("DiffuseColor", Color.Red);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.Translation = new Vector3(Window.ClientBounds.Width / 2 + 50, Window.ClientBounds.Height / 2 + 50, 0);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.SceneHints.CullHint = CullHint.Never;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.OrthoOrder = 1; //Setting the ortho order less than quad1 means this will be drawn first when in the ortho render bucket}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.SetRenderState(DepthStencilState.None);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.SetRenderState(RasterizerState.CullNone);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthos.AddChild(quad2);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus = new Torus("TransparentSphere", 30, 30, 8, 16);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.Material = ContentManager.Load<Material>("LitBasicColor.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.Material.SetParameter("MatDiffuse", Color.Green.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.Material.SetParameter("Alpha", .75f);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.SetRenderState(BlendState.AlphaBlendNonPremultiplied);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.Translation = new Vector3(30, 10, 80);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode.AddChild(transparentTorus);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox = new Box("TransparentBox", 10, 10, 10);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.Material = ContentManager.Load<Material>("LitBasicColor.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.Material.SetParameter("MatDiffuse", Color.DarkRed.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.Material.SetParameter("Alpha", .5f);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.SetRenderState(BlendState.AlphaBlendNonPremultiplied);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.Translation = new Vector3(0, 10, 50);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode.AddChild(transparentBox);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot = new Teapot("TransparentTeapot");}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.Material = ContentManager.Load<Material>("LitBasicColor.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.Material.SetParameter("MatDiffuse", Color.LightGreen.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.Material.SetParameter("Alpha", .35f);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.SetRenderState(BlendState.AlphaBlendNonPremultiplied);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.Translation = new Vector3(-10, 40, 40);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.SetScale(7.0f);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode.AddChild(transparentTeapot);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1 = new Box("OpaqueBox", 10, 10, 10);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1.Material = ContentManager.Load<Material>("LitBasicTexture.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1.Material.SetParameter("DiffuseMap", ContentManager.Load<Texture2D>("Textures//bricks_diff.dds"));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1.Translation = new Vector3(0, -10, -20);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 RootNode.AddChild(opaqueBox1);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2 = new Box("OpaqueBox", 10, 10, 10);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2.Material = ContentManager.Load<Material>("LitBasicTexture.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2.Material.SetParameter("DiffuseMap", ContentManager.Load<Texture2D>("Textures//bricks_diff.dds"));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2.Translation = new Vector3(0, 20, -20);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 RootNode.AddChild(opaqueBox2);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3 = new Box("OpaqueBox", 10, 10, 10);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3.Material = ContentManager.Load<Material>("LitBasicTexture.tem").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3.Material.SetParameter("DiffuseMap", ContentManager.Load<Texture2D>("Textures//bricks_diff.dds"));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3.Translation = new Vector3(0, 50, -20);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 RootNode.AddChild(opaqueBox3);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 RootNode.SetModelBound(new BoundingBox());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 InputLayer.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.R, false), new InputAction(}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 toggleRenderQueue = !toggleRenderQueue;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 Toggle(toggleRenderQueue, toggleTwoPass);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 )));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 InputLayer.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.T, false), new InputAction(}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 toggleTwoPass = !toggleTwoPass;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 Toggle(toggleRenderQueue, toggleTwoPass);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 )));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //Set up some text rendering}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 batch = new SpriteBatch();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 font = ContentManager.Load<SpriteFont>("Fonts//comicsans.fnt");}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 protected override void OnUpdate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //Make sure we update the ortho quads}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthos.Update(time);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 protected override void OnRenderPre(IRenderer renderer) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //This is bit of a hack - the ortho quads are not actually part of the regular scene graph,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //instead we render them before we process the scene graph for drawing.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //When we draw without the render queue we manually set an ortho camera so the quads are still}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //drawn orthographically. When we use the render queue, we draw the subtree normally and let the}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //render queue pick them up, so drawing them first will mean nothing.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 if(!toggleRenderQueue) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 Viewport viewport = Renderer.CurrentCamera.Viewport;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthoCam.Viewport = viewport;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthoCam.SetProjection(ProjectionMode.Orthographic, 0, viewport.Width, viewport.Height, 0, 0, 1);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthoCam.Update();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 ICamera oldCam = renderer.CurrentCamera;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 renderer.CurrentCamera = orthoCam;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthos.Draw(renderer);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 renderer.CurrentCamera = oldCam;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \} else \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 orthos.Draw(renderer);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 protected override void OnRenderPost(IRenderer renderer) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 batch.Begin();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 Viewport vp = renderer.CurrentCamera.Viewport;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 Vector2 pos = new Vector2(10, vp.Height - (font.MeasureString(text).Y + 10));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 batch.DrawString(font, text, pos, Color.White);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 batch.End();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 private void Toggle(bool renderQueue, bool twoPass) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //Here we toggle the render bucket types for the geometries and the sort of}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //transparent rendering when we use the render queue.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //Note that when setting the transparency type, we use a quicker way}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //than setting it to each transparent object - since all the transparent}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //meshes are attached to a single node, we can set the scene hints of that}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //node. By default all scene objects inherit their render bucket type}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //and transparency type. The same goes for most of the scene hint enumerations.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //Therefore, an object that inherits will look at their parent and their parent's parent,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //and so on to find what hint to use - if all are inherit or no parent, the default is used.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 if(renderQueue) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1.RenderBucketType = RenderBucketType.Opaque;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2.RenderBucketType = RenderBucketType.Opaque;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3.RenderBucketType = RenderBucketType.Opaque;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.RenderBucketType = RenderBucketType.Transparent;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.RenderBucketType = RenderBucketType.Transparent;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.RenderBucketType = RenderBucketType.Transparent;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.RenderBucketType = RenderBucketType.Ortho;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.RenderBucketType = RenderBucketType.Ortho;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \} else \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox1.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox2.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 opaqueBox3.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentBox.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTeapot.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transparentTorus.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad1.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 quad2.RenderBucketType = RenderBucketType.Skip;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 if(twoPass) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //This easily be:}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 //transparentBox.TransparencyType = TransparencyType.TwoSided}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode.SceneHints.TransparencyType = TransparencyType.TwoSided;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \} else \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 transpNode.SceneHints.TransparencyType = TransparencyType.OneSided;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 text = String.Format("Renderqueue: \{0\} (R)\\nTwo Pass Transparency: \{1\} (T)", renderQueue.ToString(), twoPass.ToString());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af4\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0 \}}
\par }